<style>
.dataset span.error {
position: static;
}
.longdl
{
width:600px !important;
}
.longdl input
{
width:440px;
}
</style>
<div class="pageContent">
    <form method="post"
        action="${rc.getContextPath()}/manage/management/resource/saveResource"
        class="pageForm required-validate"
        onsubmit="return validateCallback(this, dialogAjaxDone);">
        <div class="pageFormContent">
            <input type="hidden" name="navTabId" value="${navTabId!''}">
            <input type="hidden" name="id"
                value="<#if (resource.resourceCode)??>${resource.resourceCode!''}</#if>">
            <fieldset class="dataset">
                <dl>
                    <dt>资源编码：</dt>
                    <dd>
                        <input name="resourceCode"
                            value="<#if (resource.resourceCode)??>${resource.resourceCode!''}</#if>"
                            size="32" type="text" maxlength="40" class="required alphanumeric toUp"<#if
                        (resource.resourceCode)??> readonly="readonly"<#else>
                        remote="${rc.getContextPath()}/manage/management/resource/validateResourceCode"</#if> warn="资源编号已经存在"
                        /> 
                    </dd>
                </dl>
                <dl>
                    <dt>资源描述：</dt>
                    <dd>
                        <input name="resourceText"
                            value="<#if (resource.resourceText)??>${resource.resourceText!''}</#if>"
                            size="32" type="text" maxlength="60" class="required" />
                    </dd>
                </dl>
                <dl>
                    <dt>资源类型：</dt>
                    <dd>
                        <select id="resType" name="resourceTypeECode" class="required">
                                <#list resourceType as types>
                                 <option value="${types.eCode}" <#if (resource.resourceTypeECode)??
                                && (resource.resourceTypeECode == types.eCode)> selected</#if>>${types.eCodeText}</option>
                                 </#list>
                        </select>
                    </dd>
                </dl>
                <dl class="longdl">
                    <dt>Win URL：</dt>
                    <dd>
                        <input id="winUrl" name="winUrl"
                            value="<#if (resource.winUrl)??>${resource.winUrl!''}</#if>"
                            size="64" type="text" maxlength="255" />
                    </dd>
                </dl>
                <dl class="longdl">
                    <dt>Web URL：</dt>
                    <dd>
                        <input id="webUrl" name="webUrl"
                            value="<#if (resource.webUrl)??>${resource.webUrl!''}</#if>"
                            size="64" maxlength="255" type="text" />
                    </dd>
                </dl>
                <dl class="longdl">
                    <dt>Win图标URL：</dt>
                    <dd>
                        <input name="iconWinUrl"
                            value="<#if (resource.iconWinUrl)??>${resource.iconWinUrl!''}</#if>"
                            size="64" type="text" maxlength="255" />
                    </dd>
                </dl>
                <dl class="longdl">
                    <dt>Web图标URL：</dt>
                    <dd>
                        <input name="iconWebUrl"
                            value="<#if (resource.iconWebUrl)??>${resource.iconWebUrl!''}</#if>"
                            size="64" maxlength="255" type="text" />
                    </dd>
                </dl>
                <dl>
                    <dt>&nbsp;</dt>
                    <dd>
                        <label><input type="checkbox" name="lockFlag" value="1"<#if
                            (resource.lockFlag)?? && (resource.lockFlag == 1)>
                            checked="true"</#if>>锁定</label>
                    </dd>
                </dl>
            </fieldset>
        </div>
        <#if (resource.resourceCode)??> 
            <#assign createInfo=resource/>
            <#include "/admin/common/createInfo.html">
        </#if>
        <div class="formBar">
            <ul>
                <li><div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">保存</button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="buttonActiveGrey">
                        <div class="buttonContent">
                            <button type="button" class="close">取消</button>
                        </div>
                    </div></li>
            </ul>
        </div>
    </form>
</div>

<script type="text/javascript">
$(document).ready(function(){ 
$('#resType',$.pdialog.getCurrent()).change(function(){ 
    if($(this).children('option:selected').val()=="MODULE")
    {
        $('#winUrl',$.pdialog.getCurrent()).attr('disabled',"true");
        $('#winUrl',$.pdialog.getCurrent()).addClass("readonly");
        
        $('#webUrl',$.pdialog.getCurrent()).attr('disabled',"true");
        $('#webUrl',$.pdialog.getCurrent()).addClass("readonly");
    }
    else
    {
        $('#winUrl',$.pdialog.getCurrent()).removeAttr('disabled');
        $('#winUrl',$.pdialog.getCurrent()).removeClass("readonly");
        $('#webUrl',$.pdialog.getCurrent()).removeAttr('disabled');
        $('#webUrl',$.pdialog.getCurrent()).removeClass("readonly");
    }
}); 
});
</script>
